/*
 * @Desc: 
 * @Version: v1.00
 * @Author: went
 * @Date: 2023-05-29 16:35:26
 * @LastEditors: went
 * @LastEditTime: 2023-05-30 09:06:22
 */
class Shared {
  // 获取 Token
  getToken() {
    // 子应用独立运行时，在 localStorage 中获取 token
    return sessionStorage.getItem("token") || "";
  }
  // 设置 Token
  setToken(token:string) {
    // 子应用独立运行时，在 localStorage 中设置 token
    sessionStorage.setItem("token", token);
  }
}

class SharedModule {
  static shared = new Shared();
  // 重载 shared
  static overloadShared(shared:any) {
    SharedModule.shared = shared;
  }
  // 获取 shared 实例
  static getShared() {
    return SharedModule.shared;
  }
}
export default SharedModule;